interface USB {//接口不能有静态代码块和构造方法
    int a=10;//可以有常量，但默认前缀为final public static
    public int b=20;
    void openDevice();
    void closeDevice();
}
class Mouse implements USB {
    @Override
    public void openDevice() {
        System.out.println("打开鼠标");
    }
    public void closeDevice() {
        System.out.println("关闭鼠标");
    }
    public void click() {
        System.out.println("鼠标点击");
    }
}

class Computer {
    public void powerOn() {
        System.out.println("打开笔记本");
    }
    public void useDevice(USB usb) {
        usb.openDevice();
        if(usb instanceof Mouse) {
            Mouse mouse = (Mouse)usb;
            mouse.click();
        }
    }
}
public class iterface {
    public static void main(String[] args) {
        Computer computer = new Computer();
        computer.powerOn();
        computer.useDevice(new Mouse());

        System.out.println(USB.a);//可通过接口名访问，说明接口是静态的
        //USB.b=20;不能改变接口常量值
    }
}
